package com.ruowei.modules.foodOrder.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import javax.validation.constraints.*;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 商家信息表
 */
@ApiModel(description = "商家信息表")
@Entity
@Table(name = "merchant")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class Merchant implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 商家编码
     */
    @ApiModelProperty(value = "商家编码")
    @Column(name = "merchant_code")
    private String merchantCode;

    /**
     * 商家名称
     */
    @ApiModelProperty(value = "商家名称")
    @Column(name = "merchant_name")
    private String merchantName;

    /**
     * 商家地址
     */
    @ApiModelProperty(value = "商家地址")
    @Column(name = "merchant_address")
    private String merchantAddress;

    /**
     * 所在省份
     */
    @ApiModelProperty(value = "所在省份")
    @Column(name = "province")
    private String province;

    /**
     * 所在城市
     */
    @ApiModelProperty(value = "所在城市")
    @Column(name = "city")
    private String city;

    /**
     * 所在区
     */
    @ApiModelProperty(value = "所在区")
    @Column(name = "district")
    private String district;

    /**
     * 商家照片，多张用逗号分割
     */
    @Size(max = 2000)
    @ApiModelProperty(value = "商家照片，多张用逗号分割")
    @Column(name = "photos", length = 2000)
    private String photos;

    /**
     * 商家电话
     */
    @ApiModelProperty(value = "商家电话")
    @Column(name = "phone")
    private String phone;

    /**
     * 商家描述
     */
    @Size(max = 2000)
    @ApiModelProperty(value = "商家描述")
    @Column(name = "description", length = 2000)
    private String description;

    /**
     * 商家公告
     */
    @ApiModelProperty(value = "商家公告")
    @Lob
    @Column(name = "notice")
    private String notice;

    /**
     * 营业时间段，多个时间段用逗号分割
     */
    @Size(max = 1000)
    @ApiModelProperty(value = "营业时间段，多个时间段用逗号分割")
    @Column(name = "open_time", length = 1000)
    private String openTime;

    /**
     * 商家状态，营业、歇业、停业、删除
     */
    @ApiModelProperty(value = "商家状态，营业、歇业、停业、删除")
    @Column(name = "status")
    private String status;

    /**
     * 商家评分
     */
    @ApiModelProperty(value = "商家评分")
    @Column(name = "score", precision = 21, scale = 2)
    private BigDecimal score;

    /**
     * 商家粉丝数
     */
    @ApiModelProperty(value = "商家粉丝数")
    @Column(name = "fans_num")
    private Long fansNum;

    /**
     * 综合评分
     */
    @ApiModelProperty(value = "综合评分")
    @Column(name = "composite_score", precision = 21, scale = 2)
    private BigDecimal compositeScore;

    /**
     * 商品评分
     */
    @ApiModelProperty(value = "商品评分")
    @Column(name = "merchandise_score", precision = 21, scale = 2)
    private BigDecimal merchandiseScore;

    /**
     * 服务评分
     */
    @ApiModelProperty(value = "服务评分")
    @Column(name = "service_score", precision = 21, scale = 2)
    private BigDecimal serviceScore;

    /**
     * 配送评分
     */
    @ApiModelProperty(value = "配送评分")
    @Column(name = "delivery_score", precision = 21, scale = 2)
    private BigDecimal deliveryScore;

    /**
     * 优惠满减
     */
    @ApiModelProperty(value = "优惠满减")
    @Column(name = "full_discount")
    private String fullDiscount;

    /**
     * 营业执照
     */
    @ApiModelProperty(value = "营业执照")
    @Column(name = "business_license")
    private String businessLicense;

    /**
     * 起送价
     */
    @ApiModelProperty(value = "起送价")
    @Column(name = "starting_price", precision = 21, scale = 2)
    private BigDecimal startingPrice;

    // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getMerchantCode() {
        return merchantCode;
    }

    public Merchant merchantCode(String merchantCode) {
        this.merchantCode = merchantCode;
        return this;
    }

    public void setMerchantCode(String merchantCode) {
        this.merchantCode = merchantCode;
    }

    public String getMerchantName() {
        return merchantName;
    }

    public Merchant merchantName(String merchantName) {
        this.merchantName = merchantName;
        return this;
    }

    public void setMerchantName(String merchantName) {
        this.merchantName = merchantName;
    }

    public String getMerchantAddress() {
        return merchantAddress;
    }

    public Merchant merchantAddress(String merchantAddress) {
        this.merchantAddress = merchantAddress;
        return this;
    }

    public void setMerchantAddress(String merchantAddress) {
        this.merchantAddress = merchantAddress;
    }

    public String getProvince() {
        return province;
    }

    public Merchant province(String province) {
        this.province = province;
        return this;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public Merchant city(String city) {
        this.city = city;
        return this;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getDistrict() {
        return district;
    }

    public Merchant district(String district) {
        this.district = district;
        return this;
    }

    public void setDistrict(String district) {
        this.district = district;
    }

    public String getPhotos() {
        return photos;
    }

    public Merchant photos(String photos) {
        this.photos = photos;
        return this;
    }

    public void setPhotos(String photos) {
        this.photos = photos;
    }

    public String getPhone() {
        return phone;
    }

    public Merchant phone(String phone) {
        this.phone = phone;
        return this;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getDescription() {
        return description;
    }

    public Merchant description(String description) {
        this.description = description;
        return this;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getNotice() {
        return notice;
    }

    public Merchant notice(String notice) {
        this.notice = notice;
        return this;
    }

    public void setNotice(String notice) {
        this.notice = notice;
    }

    public String getOpenTime() {
        return openTime;
    }

    public Merchant openTime(String openTime) {
        this.openTime = openTime;
        return this;
    }

    public void setOpenTime(String openTime) {
        this.openTime = openTime;
    }

    public String getStatus() {
        return status;
    }

    public Merchant status(String status) {
        this.status = status;
        return this;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public BigDecimal getScore() {
        return score;
    }

    public Merchant score(BigDecimal score) {
        this.score = score;
        return this;
    }

    public void setScore(BigDecimal score) {
        this.score = score;
    }

    public Long getFansNum() {
        return fansNum;
    }

    public Merchant fansNum(Long fansNum) {
        this.fansNum = fansNum;
        return this;
    }

    public void setFansNum(Long fansNum) {
        this.fansNum = fansNum;
    }

    public BigDecimal getCompositeScore() {
        return compositeScore;
    }

    public Merchant compositeScore(BigDecimal compositeScore) {
        this.compositeScore = compositeScore;
        return this;
    }

    public void setCompositeScore(BigDecimal compositeScore) {
        this.compositeScore = compositeScore;
    }

    public BigDecimal getMerchandiseScore() {
        return merchandiseScore;
    }

    public Merchant merchandiseScore(BigDecimal merchandiseScore) {
        this.merchandiseScore = merchandiseScore;
        return this;
    }

    public void setMerchandiseScore(BigDecimal merchandiseScore) {
        this.merchandiseScore = merchandiseScore;
    }

    public BigDecimal getServiceScore() {
        return serviceScore;
    }

    public Merchant serviceScore(BigDecimal serviceScore) {
        this.serviceScore = serviceScore;
        return this;
    }

    public void setServiceScore(BigDecimal serviceScore) {
        this.serviceScore = serviceScore;
    }

    public BigDecimal getDeliveryScore() {
        return deliveryScore;
    }

    public Merchant deliveryScore(BigDecimal deliveryScore) {
        this.deliveryScore = deliveryScore;
        return this;
    }

    public void setDeliveryScore(BigDecimal deliveryScore) {
        this.deliveryScore = deliveryScore;
    }

    public String getFullDiscount() {
        return fullDiscount;
    }

    public Merchant fullDiscount(String fullDiscount) {
        this.fullDiscount = fullDiscount;
        return this;
    }

    public void setFullDiscount(String fullDiscount) {
        this.fullDiscount = fullDiscount;
    }

    public String getBusinessLicense() {
        return businessLicense;
    }

    public Merchant businessLicense(String businessLicense) {
        this.businessLicense = businessLicense;
        return this;
    }

    public void setBusinessLicense(String businessLicense) {
        this.businessLicense = businessLicense;
    }

    public BigDecimal getStartingPrice() {
        return startingPrice;
    }

    public Merchant startingPrice(BigDecimal startingPrice) {
        this.startingPrice = startingPrice;
        return this;
    }

    public void setStartingPrice(BigDecimal startingPrice) {
        this.startingPrice = startingPrice;
    }
    // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof Merchant)) {
            return false;
        }
        return id != null && id.equals(((Merchant) o).id);
    }

    @Override
    public int hashCode() {
        return 31;
    }

    @Override
    public String toString() {
        return "Merchant{" +
            "id=" + getId() +
            ", merchantCode='" + getMerchantCode() + "'" +
            ", merchantName='" + getMerchantName() + "'" +
            ", merchantAddress='" + getMerchantAddress() + "'" +
            ", province='" + getProvince() + "'" +
            ", city='" + getCity() + "'" +
            ", district='" + getDistrict() + "'" +
            ", photos='" + getPhotos() + "'" +
            ", phone='" + getPhone() + "'" +
            ", description='" + getDescription() + "'" +
            ", notice='" + getNotice() + "'" +
            ", openTime='" + getOpenTime() + "'" +
            ", status='" + getStatus() + "'" +
            ", score=" + getScore() +
            ", fansNum=" + getFansNum() +
            ", compositeScore=" + getCompositeScore() +
            ", merchandiseScore=" + getMerchandiseScore() +
            ", serviceScore=" + getServiceScore() +
            ", deliveryScore=" + getDeliveryScore() +
            ", fullDiscount='" + getFullDiscount() + "'" +
            ", businessLicense='" + getBusinessLicense() + "'" +
            ", startingPrice=" + getStartingPrice() +
            "}";
    }
}
